This file list the data files and source codes used to generated the figures in the manuscript "Samaras, G. and Meaud, J., An alternative pathway for delivery of power by outer hair cells to cochlear traveling waves

To reproduce the figures of the manuscript:
1- Download all the files included in this repository
2. Unzip the downloaded zip file
3. Unzip the zip files that include the mat files and save them in directories ParametricStudy_rDC_rRL_active, ParametricStudy_rDC_rRL_active, Models_M1M2M3M4_FreqDomain, TimeDomain_CdcCohc, TimeDomain_ModifiedM4 and PowerAnalysis : 
4. You may now run the following m files to generate the figures of the manuscript

For Fig. 3 or Fig. S2: use PlotResponsesWithDCs_SurfPlotGain_VsKdcKrl.m
This function loads data from the following folders:
	ParametricStudy_rDC_r_RL (after the file ParametricStudy_rDC_r_RL.zip is extracted)
	Models_M1M2M3M4_FreqDomain (after the file Models_M1M2M3M4_FreqDomain.zip is extracted)

For Fig. 4 or Fig. S3: use plot_vsFreq_fromTimeDomain.m
This script loads model simulation data located in the TimeDomain_CdcCohc folder (after the TimeDomain_CdcCohc.zip file is extracted)
This script also calls plotDewey_vs_freq to plot the experimental data from the article
Dewey, J.B., Altoè, A., Shera, C.A., Applegate, B.E. and Oghalai, J.S., 2021. Cochlear outer hair cell electromotility enhances organ of Corti motion 
on a cycle-by-cycle basis at high frequencies in vivo. Proceedings of the National Academy of Sciences, 118(43), p.e2025206118.
Experimental data from Dewey et al., 2021 is downloadable at https://github.com/jso111/Dewey2021r. 
Once you have downloaded the experimental data, you should save the mat files in the Dewey2021_data folder
Plotting of Dewey et al. data can be turned off by setting the variable plotDewey2021 to 0 in plot_vsFreq_fromTimeDomain.m

For Fig. 6: use plotTimeDomain_tonic.m
This script loads data located in the TimeDomain_CdcCohc folder (after the TimeDomain_CdcCohc.zip file is extracted)
This script also load experimental data from Dewey et al. from the Dewey2021_data folder
Plotting of Dewey et al. data can be turned off by setting the variable plotDewey2021 to 0 in plotTimeDomain_tonic.m

For Fig. 7: use powerAnalysis.m 
This script loads data in the PowerAnalysis folder (after the PowerAnalysis.zip is extracted)

For Fig. 9: use plot_vsFreq_fromTimeDomain_modifiedM4.m
This script loads data in the TimeDomain_ModifiedM4 folder (after the TimeDomain_ModifiedM4.zip is extracted)



Helper functions called by the functions listed above:
find2.m
find3.m
convertSPLtoPressureInPascals.m
computeFFT2_FlatTopWindow.m
calculateQ.m


